<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    info: { type: Object, required: true },
  },
});
</script>

<template>
  <view class="jps-item">
    <image class="jps-item-img" :src="info.cover_pic" mode="aspectFill" />
    <view class="jps-item-content">
      <view class="jps-item-name">{{ info.product_name }}</view>
      <view style="display: flex; align-items: flex-end">
        <view class="jps-item-position">
          <image
            class="jps-item-position2"
            src="@/package/mall/static/train-position.png"
          />
          {{ info.scenic_name }}
        </view>
        <view class="jps-item-btn">预约</view>
      </view>
    </view>
  </view>
</template>

<style lang="scss">
.jps-item {
  display: flex;
  align-items: center;
  padding: 20rpx;
  border-radius: 20rpx;
  background-color: #ffffff;

  .jps-item-img {
    flex-shrink: 0;
    width: 176rpx;
    height: 134rpx;
    border-radius: 20rpx;
  }

  .jps-item-content {
    flex-grow: 1;
    min-width: 0;
    margin-left: 20rpx;
  }

  .jps-item-name {
    max-height: 84rpx;
    font-size: 30rpx;
    color: #333333;
    line-height: 42rpx;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .jps-item-position {
    display: flex;
    align-items: center;
    height: 34rpx;
    font-size: 24rpx;
    color: #7b7c84;
  }

  .jps-item-position2 {
    width: 20rpx;
    height: 20rpx;
    margin-right: 6rpx;
  }

  .jps-item-btn {
    padding: 0 26rpx;
    margin-left: auto;
    font-size: 24rpx;
    color: #ffffff;
    line-height: 50rpx;
    font-weight: bold;
    border-radius: 32rpx;
    background: linear-gradient(206deg, #fe810a 0%, #faa360 100%);
  }
}
</style>